<?php
ob_start();
include("header.php");
?>

<?php
include("code/databaseconnection.php");
?>
<form id="form1" name="form1" method="post" action="workshop.php?action=save" >
  <table width="600" cellspacing="0" cellpadding="0">
   
     <tr>
      <td width="199">Title</td>
      <td width="399"><input type="text" name="title" size="30"  /></td>
    </tr>
    
    <tr>
    <td>Subject:</td>
      <td><input type="text" name="subject" size="30"/></td>
    </tr>
    
    
    <tr>
      <td>Subject Year</td>
      <td><input type="text" name="subject_year" size="30" /></td>
    </tr>
    
    <tr>
      <td>Num Days</td>
      <td><input type="text" name="num_days" size="30" /></td>
    </tr>
    
    <tr>
      <td>Start Date</td>
      <td><input type="text" name="start_date" sze="30" /></td>
    </tr>
    
    <tr>
      <td>End Date</td>
      <td><input type="text" name="end_date" sze="30" /></td>
    </tr>
    
    
    
    <tr>
      <td>Venue</td>
      <td><input type="text" name="venue" size="30" /></td>
    </tr>
    
    <tr>
      <td>Num Participant</td>
      <td><input type="text" name="number_of_participant" size="30" /></td>
    </tr>
    
    <tr>
      <td>Num Resource</td>
      <td><input type="text" name="number_of_resoruce" size="30" /></td>
    </tr>
    
    <tr>
      <td>Limits</td>
      <td><input type="text" name="limits" size="30" /></td>
    </tr>
    
    <tr>
   		<td>Condecting Agency</td>
      <td><input type="text" name="condecting_agency" size="30" /></td>
    </tr>
    
    <tr>
   		<td>Vote Number</td>
      <td><input type="text" name="vote_num" size="30" /></td>
    </tr>
    
    <tr>
   		<td>Funding</td>
      <td><input type="text" name="funding" size="30" /></td>
    </tr>
    
    <tr>
   		<td>Source</td>
      <td><input type="text" name="source" size="30" /></td>
    </tr>
    
    <tr>
   		<td>Estimate cost</td>
      <td><input type="text" name="estimate_cost" size="30" /></td>
    </tr>
    
    <tr>
   		<td>Actual Cost</td>
      <td><input type="number" min="1" max="5" name="actual_cost" size="30" /></td>
    </tr>
<!--   <tr>
   		<td>Id Number</td>
      <td><input type="number" min="1" max="5" name="id_number" size="30" /></td>
    </tr>
    -->
   
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="button" id="button" value="Submit" /></td>
    </tr>
    
  </table>

</form>
<?php
if($_GET['action']== "save")
{
	$g_title=$_POST['title'];
	$g_subject=$_POST['subject'];
	$g_subject_year=$_POST['subject_year'];
	
	$g_num_days=$_POST['num_days'];
	$g_start_date=$_POST['start_date'];
	$g_end_date=$_POST['end_date'];
	$g_venue=$_POST['venue'];
	$g_number_of_participant=$_POST['number_of_participant'];
	$g_number_of_resoruce=$_POST['number_of_resoruce'];
	$g_limits=$_POST['limits'];
	$g_condecting_agency=$_POST['condecting_agency'];
	$g_vote_num=$_POST['vote_num'];
	$g_funding=$_POST['funding'];
	$g_source=$_POST['source'];
	$g_estimate_cost=$_POST['estimate_cost'];
	$g_actual_cost=$_POST['actual_cost'];
	// echo $g_id_number=$_POST['id_number'];
	
	

	

		
		mysql_query("INSERT INTO workshop  (TITLE,SUBJECT,SUBJECT_YEAR,NUM_OF_DAYS,START_DATE,END_DATE,VENUE,NUM_OF_PARTICIPANT,NUM_OF_RESOURCE,LIMITS,CONDUCTING_AGENCY,VOTE_NUM,FUNDING,SOURCE,ESTIMATE_COST,ACTUAL_COST) VALUES('$g_title','$g_subject','$g_subject_year','$g_num_days','$g_start_date','$g_end_date','$g_venue','$g_number_of_participant','$g_number_of_resoruce','$g_limits','$g_condecting_agency','$g_vote_num','$g_funding','$g_source','$g_estimate_cost','$g_actual_cost') ") or die(mysql_error());
		
		echo "registed";
		
		
			

	
	}
include("fooder.php");
	
?>
